package com.Arr;

import java.util.ArrayList;
import java.util.Random;

/*
要写注释哦!!!
*/
public class Demo03 {
    public static void main(String[] args) {
        ArrayList<Integer> arr = new ArrayList<>();
        ArrayList<Integer> newArr = new ArrayList<>();
        Random r = new Random();
        for (int i = 0; i < 10; i++) {
            int number = r.nextInt(100) + 1;
            arr.add(number);
        }
        System.out.print(arr + "\t");
        System.out.println();
        for (int i = 0; i < arr.size(); i++) {
            if (arr.get(i) % 2 == 0) {
                newArr.add(arr.get(i));
            }
        }
        System.out.print(newArr + "\t");
    }
}
